from Actors.Sprite import Sprite
from Scene.Base_Scene import BaseScene, ScenePassStatus
from Scene.Task_Scene.Task1 import Task1Scene


class WelcomeScene(BaseScene):
    """
    欢迎场景
    """

    def __init__(self):
        super(WelcomeScene, self).__init__("Resources/images/welcome/welcome.jpg")
        self.wel_sprite = Sprite(50, 300, "Resources/images/welcome/%d-1.png", 9)

    def draw_actor(self):
        self.wel_sprite.draw(self.current_surface)

    def run(self, down_flag, key_list):
        self.wel_sprite.run_by_self()
        if self.wel_sprite.pos_x > 1000:
            self.next_status = ScenePassStatus.over

    def get_next_status(self):
        """
        获取下一状态
        :return:
        """
        if self.next_status != ScenePassStatus.over:
            return self.next_status, None
        else:
            return self.next_status, "Task1Scene"
